package interview.atoi;

public class A2I {
	public int atoi(String str) {
		char[] array = str.toCharArray();
		int result = 0;
		for(int i = 0; i < str.length(); i++) {
			result *= 10;
			result += array[i] - '0';
		}

		return result;
	}
}
